﻿using SweetSurvey.Models.Repositories;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting.Web;
using System.Collections.Generic;

namespace SweetSurvey.Tests.RepositoryTests
{
    
    
    /// <summary>
    ///This is a test class for RepositoryBaseTest and is intended
    ///to contain all RepositoryBaseTest Unit Tests
    ///</summary>
    [TestClass()]
    public class RepositoryBaseTest : RepositoryTestBase
    {
        /// <summary>
        ///A test for GenerateRandomId
        ///</summary>
        [TestMethod()]
        public void GenerateRandomIdTest()
        {
            var ids = new HashSet<string>();
            for (var i = 0; i < 500; i++)
            {
                var id = RepositoryBase.GenerateRandomId();
                Assert.IsFalse(ids.Contains(id));
                ids.Add(id);
            }
            Assert.AreEqual(ids.Count, 500);
        }
    }
}
